package javaAPI.String.String2;

import java.util.Scanner;

public class String1 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入一个字符串");
        String str=sc.next();
        int bigcount=0;
        int smallcount=0;
        int numbercount=0;
        for (int i = 0; i < str.length(); i++) {
            //i表示字符串的索引
            char c=str.charAt(i);//遍历字符串获得元素
            if (c>='a'&&c<='z'){
                smallcount++;
            }else if (c>='A'&&c<='Z'){
                bigcount++;
            }else if (c>='0'&&c<='9'){
                numbercount++;
            }
        }
        System.out.println("小写的字符有"+smallcount+"个,大写的字符有"+bigcount+"个,数字字符有"+numbercount+"个");
    }
}
